﻿//arcgis服务
function ArcgisService(layerInfo) {
    var ArcgisService = new Object;
    ArcgisService.id = layerInfo.hasOwnProperty("GUID") ? layerInfo.GUID : "";
    ArcgisService.url = layerInfo.hasOwnProperty("URL") ? layerInfo.URL : "";
    ArcgisService.name = layerInfo.hasOwnProperty("NAME") ? layerInfo.NAME : "";
    ArcgisService.servertype = layerInfo.hasOwnProperty("SERVERTYPE") ? layerInfo.SERVERTYPE : "";
    ArcgisService.showLayer = (layerInfo.hasOwnProperty("PARAMETERS") && layerInfo.PARAMETERS != "") ? layerInfo.PARAMETERS : layerInfo.ID;
    ArcgisService.CreateLayer = function () {
        var id = this.id;
        var url = this.url;
        var name = this.name;
        var servertype = this.servertype;
        var showLayer = this.showLayer == "" ? "" : "show:" + this.showLayer;
        var proxyUrl = "";
        var layers = viewer.imageryLayers;
        var layerindex = layers._layers.length;
        var thisLayer = layers.addImageryProvider(new Cesium.ArcGisMapServerImageryProvider({
            url: url
        }));
        checkLayerTransparent(thisLayer, id);
        return thisLayer;
    }
    return ArcgisService;
}